//package binary_tree.Newcode;
//public class CovertTree {
//    public TreeNode Convert(TreeNode pRootOfTree) {
//    if(pRootOfTree==null||(pRootOfTree.left==null&&pRootOfTree.right==null)){
//        return pRootOfTree;
//    }
//    TreeNode left=Convert(pRootOfTree.left);
//    TreeNode leftTail=left;
//    while(leftTail!=null&&leftTail.right!=null){
//        leftTail=leftTail.right;
//    }
//    if(leftTail!=null){
//        leftTail.right=pRootOfTree;
//        pRootOfTree.left=leftTail;
//    }
//    TreeNode right=Convert(pRootOfTree.right);
//    if(right!=null){
//        right.left=pRootOfTree;
//        pRootOfTree.right=right;
//
//    }
//    return left==null?pRootOfTree:left;
//    }
//}
